$OpenBSD: patch-src_ass_y,v 1.2 2015/11/15 11:55:59 jca Exp $

- Bison 3 fixes.
- logic fix for a==b==c case.

--- src/ass.y.orig	Fri Apr 22 07:31:53 2005
+++ src/ass.y	Mon Nov  9 00:11:33 2015
@@ -25,17 +25,17 @@
 #include "ass.h"
 #include "ass.tab.h"
 
-#define 		YYLEX_PARAM 	lexer_ctl
-#define 		YYPARSE_PARAM 	lexer_ctl
 #define 		line 			(((lexerctl_t*)lexer_ctl)->line)
 #define 		pos 			(((lexerctl_t*)lexer_ctl)->c)
 
-int yyerror( const char *s );
+int yyerror( void *lexer_ctl, const char *s );
 int yylex (YYSTYPE *lval, void* lexer_ctl);
 
 %}
 
-%pure_parser
+%define api.pure
+%parse-param { void *lexer_ctl }
+%lex-param { void *lexer_ctl }
 
 %union{
 	int 	letter;
@@ -224,7 +224,7 @@ var_t Op(var_t var1, var_t var2, int op_type){
 				break;
 		case '/':res.number=var2.number?var1.number/var2.number:1;
 				break;
-		case NE :if(var1.type==var2.type==t_STRING) res.number=STRCMP(var1.string,var2.string);
+		case NE :if(var1.type==(var2.type==t_STRING)) res.number=STRCMP(var1.string,var2.string);
 					else res.number=(var1.number!=var2.number);
 				break;
 		case '=':if(var1.type==t_STRING && var2.type==t_STRING) res.number=!STRCMP(var1.string,var2.string);
@@ -258,7 +258,7 @@ var_t Op(var_t var1, var_t var2, int op_type){
 	return res;
 }
 
-int yyerror (const char *s) /* ��뢠���� yyparse � ��砥 �訡�� */
+int yyerror (void *lexer_ctl, const char *s) /* ��뢠���� yyparse � ��砥 �訡�� */
 {
 	printf ("\n(error in template)\n");
 	return 1;
@@ -308,7 +308,7 @@ int iskeyword(char* string){
 #define skip_digit(a,b) {while(isdigit(a[(b)])) (b)++;}
 #define skip_alpha(a,b) {while(isalpha(a[(b)])) (b)++;}
 
-int yylex (YYSTYPE *yylval, void* lexer_ctl){
+int yylex (YYSTYPE *yylval, void *lexer_ctl){
 	char *buffer=NULL;
 	char *string=NULL;
 	char *string_pointer;
